package tests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import transformers.ContextTransformer;
import utils.Node;
import utils.TreeUtils;
import exceptions.AmbiguityException;

public class ContextTestBaseCase {

	@Test
	public final void testGetContext() throws AmbiguityException 
	{
		// initialization
		TreeConstants.init();
		Node configuration = TreeConstants.configuration;
		Node rule = TreeConstants.rule3;
		
		// verify
		ContextTransformer ct = new ContextTransformer(configuration);
		Node context = ct.getContext(rule);
		assertTrue(context != null);
		
		// print results
		System.out.println("Configuration:");
		TreeUtils.printTree(configuration, "");
		System.out.println("Rule:");
		TreeUtils.printTree(rule, "");
		System.out.println("Context:");
		TreeUtils.printTree(context, "");
	}
}
